<html lang="zh-CN">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="./img/icon.png">

    <title>Fixed Top Navbar Example for Bootstrap</title>

    <!-- Bootstrap core CSS -->
    <link href="./css/bootstrap.min.css" rel="stylesheet">
	<style type="text/css">
        .show-grid [class ^="col-"] {
            padding-top: 5px;
            padding-bottom: 5px;
            /*background-color: #eee;*/
            border: 1px solid #ddd;
			
            /*background-color: rgba(86, 61, 124, .15);*/
            /*border: 1px solid rgba(86, 61, 124, .2);*/
        }
        </style>
</head>
<body>
	<div class="container-fluid" style="width: 100%;">
		<!--
		<div class="row show-grid">
			<div class="col-md-12">
				<div class="text-center" style="height: 60px; padding-top: 5px; padding-bottom: 5px; background-color: #eee;">
					
					<p>lala</p>
					
				</div>
			</div>
		</div>
		-->
		<div class="row" style="margin-top: 15px; margin-bottom: 15px; border-bottom: 1px solid #eee;">
			<div class="col-md-12">
				<div class="text-center" style=" border-radius:0px; height: 60px; padding-top: 5px; padding-bottom: 5px; /*background-color: #eee;*/">
					<a style="color: #27aac8; font-weight: normal; display: block; padding: 3px 0; text-decoration: none; font-size: 25px;">
						我的朋友列表
					</a>
				</div>
			</div>
		</div>
		<?php
			include('./db/dbconn.php');
			if (isset($_COOKIE["user"])) {
				$user = $_COOKIE["user"];
			}
			$sql = "select my_id, friends_id from friend where my_id = '$user'";
			$check_query = mysqli_query($conn, $sql);
			$i = 0;
			$result = mysqli_fetch_array($check_query);
			$my_id = $result['my_id'];
			$friends_id = $result['friends_id'];
			$friends_id = iconv('gbk', 'utf-8', $friends_id);
			$re = explode(',', $friends_id);
			$cnt = count($re);
			for ($i = 0; $i < $cnt; $i++) {
		?>
		<div class="row" style="height: 51px; border-bottom: 1px solid #eee; padding-top: 5px; padding-bottom: 5px;">
			<div class="col-md-1" style="height: 51px;">
				<div style="height: 35px; padding-top: 3px; padding-bottom: 3px;">
					
					<img src="./img/head_<?php echo $i; ?>.png" style="height:29px; width:25px;"/>
				</div>
			</div>
			<div class="col-md-2" style="height: 51px;">
				<div style="padding-top: 0px; border: 0px solid red;">
					<span style="height: 15px;" class="glyphicon glyphicon-user"></span>
					<span><strong>姓名:</strong><?php echo $re[$i]; ?></span>
				</div>
				<div style="padding-top: 0xp; border: 0px solid red; height:19px;">
						<!--
						<?php
						for ($j = 1; $j <= $i+1; $j++){
						?>
						<span class="glyphicon glyphicon-star-empty"></span>
						<?php
						}
						?>
						-->
				</div>
				
			</div>
			<div class="col-md-2" style="height: 51px;">
				<div style="height: 35px; padding-top: 8px; padding-bottom: 8px;">
					<a style="text-decoration: none;">个人说明:</a>他很懒什么都没留下...
				</div>
			</div>
			<div class="col-md-3" style="height: 51px;">
				<div style="height: 35px; padding-top: 8px; padding-bottom: 8px;">
					<a style="text-decoration: none;">亲密度:</a>
					<?php
					$num = rand(1, 5);
					for ($j = 1; $j <= $num; $j++){
					?>
					<span class="glyphicon glyphicon-heart"></span>
					<?php
					}
					?>
					<?php
					for ($j = 1; $j <= 5-$num; $j++){
					?>
					<span class="glyphicon glyphicon-heart-empty"></span>
					<?php
					}
					?>
				</div>
			</div>
			
			<div class="col-md-offset-1 col-md-2" style="height: 51px;">
				<div style="height: 35px; padding-top: 8px; padding-bottom: 8px;">
					<span class="glyphicon glyphicon-share-alt"></span><a href="" >详细信息</a>
				</div>
			</div>
		</div>
		<?php
			}
		?>
	</div>
</body>
</html>